package de.dqi.pong.menu;

import java.awt.Font;

import javax.swing.*;

/**
 * TODO EndMenu - finish class definition
 * <hr>
 * 
 * <hr><dl><dt>
 * Summary: </dt><br><dd>
 *  
 * </dd><br><dt>
 * Author: </dt><br><dd>
 *  Melina
 * </dd></dl>
 */
public class EndMenu
		extends MenuPanel {
	
	private static final long	serialVersionUID	= 4123157239432552031L;
	private JLabel				name;
	private JLabel				score;
	
	public EndMenu(JPanel startGui) {
		setSize(250, 300);
		setLayout(null);
		
		parent = startGui;
		
		name = new JLabel();
		name.setText("NoName");
		name.setHorizontalAlignment(SwingConstants.CENTER);
		name.setVerticalAlignment(SwingConstants.BOTTOM);
		name.setFont(new Font("Times New Roman", Font.BOLD, 30));
		name.setBounds(0, 25, 250, 50);
		add(name);
		
		JLabel message = new MenuLabel(3);
		message.setText("has won");
		message.setHorizontalAlignment(SwingConstants.CENTER);
		message.setVerticalAlignment(SwingConstants.TOP);
		message.setFont(new Font("Times New Roman", Font.PLAIN, 14));
		message.setBounds(0, 75, 250, 25);
		add(message);
		
		JLabel scoreMessage = new JLabel();
		scoreMessage.setText("Final score:");
		scoreMessage.setHorizontalAlignment(SwingConstants.CENTER);
		scoreMessage.setVerticalAlignment(SwingConstants.BOTTOM);
		scoreMessage.setFont(new Font("Times New Roman", Font.PLAIN, 14));
		scoreMessage.setBounds(0, 125, 250, 25);
		add(scoreMessage);
		
		score = new JLabel();
		score.setText("REKT:????");
		score.setHorizontalAlignment(SwingConstants.CENTER);
		score.setFont(new Font("Times New Roman", Font.BOLD, 30));
		score.setBounds(0, 150, 250, 50);
		add(score);
		
		JButton replay = new MenuButton(Frame.PLAYMENU);
		replay.setText("Play Again");
		replay.setBounds(0, 200, 250, 50);
		replay.addActionListener(MenuListener.getInstance());
		add(replay);
		
		JButton back = new MenuButton(0);
		back.setText("Main Menu");
		back.setBounds(0, 250, 250, 50);
		back.addActionListener(MenuListener.getInstance());
		add(back);
		
	}
	
	void setWinner(String winner) {
		this.name.setText(winner);
	}
	
	void setScore(String score) {
		this.score.setText(score);
	}
	
}
